package com.zlp.mall.modules.pms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zlp.mall.modules.pms.mapper.ProductFullReductionMapper;
import com.zlp.mall.modules.pms.model.ProductFullReduction;
import com.zlp.mall.modules.pms.model.ProductLadder;
import com.zlp.mall.modules.pms.service.ProductFullReductionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 产品满减表(只针对同商品) 服务实现类
 * </p>
 *
 * @author ZouLiPing
 * @since 2021-09-23
 */
@Service
@Slf4j(topic = "ProductFullReductionServiceImpl")
public class ProductFullReductionServiceImpl extends ServiceImpl<ProductFullReductionMapper, ProductFullReduction> implements ProductFullReductionService {

    @Override
    public List<ProductFullReduction> getByProductId(Long productId) {

        log.info("getByProductId.req productId={}",productId);
        LambdaQueryWrapper<ProductFullReduction> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProductFullReduction::getProductId,productId);
        return this.list(queryWrapper);
    }
}
